<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico"> 
	<link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/uploadify/uploadify.css"/>
    <script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
</head>

<script>
var pnum = {$pnum};
var filter = {$filter};
{if condition="(!isset($search)) OR (!$search)"}
var url = "/{$Request.module}/shop_txmx/lst/filter/"+filter+".html?page="+pnum;
{else/}
var url = "/{$Request.module}/shop_txmx/search.html?page="+pnum;
{/if}
</script>

<body class="gray-bg">
<style>
input.error{
	border:1px solid red;
}
span.error{
	padding-top:10px;
	color: #f00;
	font-size:12px;
}
</style>

    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>商家提现打款设置</h5>
                    </div>
                    <div class="ibox-content">
                        <form method="post" class="form-horizontal" id="form">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">流水单号：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.tx_number}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                            <label class="col-sm-2 control-label">申请时间:</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{:date('Y-m-d H:i:s',$txs['time'])}</div>
                                </div> 
                            </div>				
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商家名称：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.shop_name}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商家联系手机号：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.telephone}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商家绑定手机号：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.phone}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">钱包余额：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.wallet_price}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">提现金额：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.price}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">银行卡号：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.card_number}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">所属银行：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.bank_name}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">开户行省市区：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.shengshiqu}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">所属支行：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.branch_name}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">真实姓名：</label>
                                <div class="col-sm-6">
                                    <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$txs.zs_name}</div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">打款是否成功：</label>
                                <div class="col-sm-6" id="atype">
                                        <label class="radio-inline"><input type="radio" name="complete" {if condition="$txs['complete'] eq 1"}checked="checked"{/if} value="1">打款成功</label>
                                        <label class="radio-inline"><input type="radio" name="complete" {if condition="$txs['complete'] eq 2"}checked="checked"{/if} value="2">打款失败</label>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="adurl"></div> 
                            
                            <div class="adurl" style="display:none">
                            <div class="form-group">
                            <label class="col-sm-2 control-label">失败原因:</label>
                                <div class="col-sm-6">
                                    <textarea name="remarks" id="remarks" class="form-control"></textarea>
                                </div> 
                            </div>				
                            <div class="hr-line-dashed"></div> 
                            </div>
                           
                            <input type="hidden" name="id" value="{$txs.id}" />
                           
                                                               
                           <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="button" id="doSubmit" style="margin-right:50px;">保存设置</button>
                                </div>
                            </div>
                            
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- 全局js -->
    <script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- 自定义js -->
    <script type="text/javascript" src="__PUBLIC__/uploadify/jquery.uploadify.min.js"></script>
    <script src="__PUBLIC__/admin/js/plugins/layer/layer.min.js"></script>
    <script src="__PUBLIC__/admin/js/plugins/validate/jquery.validate.min.js"></script>	
    <!-- iCheck -->
    <script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/admin/js/common/ajax.js"></script>

	<script>
      $(function(){ 
		  $('#atype .radio-inline').click(function(){
			  var i = $(this).index();
			  $('.adurl').hide();
			  $('.adurl').eq(i).show();
		  });
    	  
    	  $('#doSubmit').click(function(){
    		  var dkcanshu = $('input:radio[name=complete]:checked').val();
    		  if(dkcanshu == null){
    			  layer.msg('请选择打款成功或不成功', {icon: 2,time: 1000});
    			  return false;
    		  }
    			
    		  if('1,2'.indexOf(dkcanshu) == -1){
    			  layer.msg('参数错误', {icon: 2,time: 1000});
    			  return false;
    		  }
    		  
    		  if(dkcanshu == 1){
    			  var shuoming = '确定打款成功么？不可撤销';
    		  }
    		  
    		  if(dkcanshu == 2){
    			  var shuoming = '确定打款失败么？不可撤销';
    			  var remarks = $('#remarks').val();
    			  if(remarks == ''){
    				  layer.msg('请填写打款失败原因', {icon: 2,time: 1000});
        			  return false;
    			  }
    		  }
    		  
	  		  layer.confirm(shuoming, {  			  
				  skin: 'layui-layer-molv',
				  closeBtn: 0,
				  shadeClose : true,
				  btn: ['确定','取消'] //按钮
			  },function(){
				  layer.load(2);
				  
			      $.ajax({
				      url:"{:url('shop_txmx/dakuan')}",
				      type:'POST',
				      data:$('#form').serialize(),
				      dataType:'json',
				      success:function(data){
				    	  if(data.status == 1){
				    		  layer.closeAll('loading');
				    		  layer.msg(data.mess, {icon: 1,time: 1000}, function(){
	                               parent.location.href = url;
				    		  });
				    	  }else if(data.status == 0){
				    		  layer.closeAll('loading');
				    		  layer.msg(data.mess, {icon: 2,time: 1000});
				    	  }
				      },
				      error:function(){
				    	  layer.closeAll('loading');
				    	  layer.msg('操作失败，请重试', {icon: 2,time: 2000});
				      }
				  });
			  });
    	  });
      });
    	
      function cl(){
    	  parent.location.href = url;
      }
    </script>

</body>
</html>